﻿@using EasyMvcBlog.DTO
@using Webdiyer.WebControls.Mvc;
@model PagedArticleDTO
<div class="content-box">
    <div class="content-box-header">
        <span>管理文章</span>
    </div>
    <div class="content-box-content">
        <table class="easyShowTable" width="100%" style="margin-bottom:20px;">
            <thead>
                <tr>
                    <th>
                        文章标题
                    </th>
                    <th>
                        发布日期
                    </th>
                    <th>
                        删除
                    </th>
                </tr>
            </thead>
            @foreach (ArticleDTO articleDto in Model.Articles)
            {
                <tr>
                    <td>
                        @Html.RouteLink(articleDto.Title, "Default", new { controller = "Admin", action = "EditArticle", id = articleDto.Id })
                    </td>
                    <td>
                        @articleDto.CreateTime
                    </td>
                    <td>
                        <img src=@Url.Content("~/Themes/Green/Images/delete.png") />
                    </td>
                </tr>
            }
        </table>
        @if (Model.TotalPage > 0)
        {
            <div style="color:#505050; vertical-align:bottom;height:25px; line-height:25px;float:left;">共 @Model.TotalCount 条记录，共 @Model.TotalPage 页</div>
        }
        @Html.Pager(Model.Articles, new PagerOptions
   {
       PageIndexParameterName = "id",
       CurrentPagerItemWrapperFormatString = "<span class=\"cpb\">{0}</span>",
       NumericPagerItemWrapperFormatString = "<span class=\"item\">{0}</span>",
       ShowPageIndexBox = false,
       ShowMorePagerItems = true,
       ShowFirstLast = true,
       NumericPagerItemCount = 8,
       PageIndexBoxWrapperFormatString = "go to {0}",
       GoToPageSectionWrapperFormatString = "<span class=\"gotoPage\">{0}</span>",
       CssClass = "pages",
       SeparatorHtml = "",
       HorizontalAlign="right"
   })
    </div>
</div>
<div class="clear">
</div>
